/*
 * Copyright 2013-2015 the original author or authors.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xdtech.jmax.test;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.xdtech.sys.model.Task;
import com.xdtech.sys.vo.TaskItem;

/**
 * 
 * @author max.zheng
 * @create 2015-5-11下午10:36:55
 * @since 1.0
 * @see
 */
public class QuartzTaskFactory implements Job {
	  
	 @Override
	 public void execute(JobExecutionContext context)
	   throws JobExecutionException {
	  // TODO Auto-generated method stub
	  try {
	   System.out.println("任务运行...");
	   TaskItem task = (TaskItem) context.getMergedJobDataMap().get(
	     "scheduleJob");
	   System.out.println("任务名称: [" + task.getName() + "]");
	   //在这里执行你的任务...
	   } catch (Exception e) {
	   e.printStackTrace();
	  }
	 }
	}

